import 'package:flutter/material.dart';

class ConstPage extends StatefulWidget {
  const ConstPage({super.key});

  @override
  State<StatefulWidget> createState() {
    return _ConstPageState();
  }
}

class _ConstPageState extends State<ConstPage> {

  late String _content;

  @override
  void initState() {
    var a = const Point(10, 10);
    var b = const Point(10, 10);
    // const a = Point(10, 10);
    // const b = Point(10, 10);
    _content = identical(a, b) ? 'same' : 'different';
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('Const'),
        ),
        body: Center(
          child: Text(_content),
        )
    );
  }
}

class Point {
  final int x;
  final int y;

  const Point(this.x, this.y);
}